<?php

namespace app\Modules\Api\controllers;



use Yii;
use app\models\Idea;
use app\filters\Json;

/**
 * Class IdeaController
 * @package app\Modules\Api\controllers
 */
class IdeaController extends ControllerBase
{
    public function actionCreate()
    {
        $idea = new Idea();
        if($idea->load(Yii::$app->request->post(),'')&&$idea->save())
            return Json::success();
        return Json::error(strval(current($idea->getFirstErrors())));
    }
}